package com.ruoyi.smartHighway.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
        import com.ruoyi.common.utils.DateUtils; //需要修改成自己的包名
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartHighway.mapper.GuestMapper;
import com.ruoyi.smartHighway.domain.Guest;
import com.ruoyi.smartHighway.service.IGuestService;


/**
 * 客户 Service业务层处理
 *
 * @author ljj
 * @date 2024-08-05
 */
@Service
public class GuestServiceImpl extends ServiceImpl<GuestMapper,Guest> implements IGuestService {

    @Autowired
    private GuestMapper guestMapper;

    /**
     * 查询客户 
     *
     * @param id 客户 主键
     * @return 客户 
     */
    @Override
    public Guest selectGuestById(Long id) {
        return guestMapper.selectGuestById(id);
    }

    /**
     * 查询客户 列表
     *
     * @param guest 客户 
     * @return 客户 
     */
    @Override
    public List<Guest> selectGuestList(Guest guest) {
        return guestMapper.selectGuestList(guest);
    }

    /**
     * 新增客户 
     *
     * @param guest 客户 
     * @return 结果
     */
    @Override
    public int insertGuest(Guest guest) {
                guest.setCreateTime(DateUtils.getNowDate());
            return guestMapper.insertGuest(guest);
    }

    /**
     * 修改客户 
     *
     * @param guest 客户 
     * @return 结果
     */
    @Override
    public int updateGuest(Guest guest) {
                guest.setUpdateTime(DateUtils.getNowDate());
        return guestMapper.updateGuest(guest);
    }

    /**
     * 批量删除客户 
     *
     * @param ids 需要删除的客户 主键
     * @return 结果
     */
    @Override
    public int deleteGuestByIds(Long[] ids) {
        return guestMapper.deleteGuestByIds(ids);
    }

    /**
     * 删除客户 信息
     *
     * @param id 客户 主键
     * @return 结果
     */
    @Override
    public int deleteGuestById(Long id) {
        return guestMapper.deleteGuestById(id);
    }
}

